package com.sanpu.kxe.business.main.adapter;

import android.text.TextUtils;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sanpu.kxe.R;
import com.sanpu.kxe.business.main.bean.PointDetailOutput;

import java.util.ArrayList;

/**
 * Description：我的积分列表
 * Created by 薛勇军 on 2018/7/18.
 */

public class MyScoreAdapter extends BaseQuickAdapter<PointDetailOutput, BaseViewHolder> {


    public MyScoreAdapter() {
        super(R.layout.item_my_score, new ArrayList<PointDetailOutput>());
    }

    @Override
    protected void convert(BaseViewHolder helper, PointDetailOutput item) {
        if (item == null) return;
        String srcUser = item.getuAccountName();
        if (TextUtils.isEmpty(srcUser)) {
            srcUser = "-";
        }
        String payType = item.getPayType();
        if (TextUtils.isEmpty(payType)) {
            payType = "-";
        }
        helper.setText(R.id.src, srcUser)
                .setText(R.id.type, payType)
                .setText(R.id.score, TextUtils.isEmpty(item.getBp()) ? "0" : item.getBp())
                .setText(R.id.time, TextUtils.isEmpty(item.getTxnTm()) ? "" : item.getTxnTm());
    }
}
